package com.nation.domain;

import javax.persistence.*;
import java.io.Serializable;

/**
 * Created by dqd on 2017/11/18.
 */
@Entity
@Table(name = "T_population", schema = "show_nation", catalog = "")
public class TPopulation implements Serializable{
    private int id;
    private Double mid_year_population;
    private Double population_rate_0;
    private Double population_rate_15;
    private Double population_rate_65;
    private Double female_rate;
    private Double increase_rate;
    private Double density;
    private Double birth_rate;
    private Double ave_life;
    private Double total_birth_rate;
    private Double death_rate;
    private Double baby_death_rate;
    private Double dependency_rate;
    private Double city_population;
    private Double city_population_rate;
    private Double village_population;
    private String year;
    private String country_code;
    private String continent;
    private String source;
    private String source_database;

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getSource_database() {
        return source_database;
    }

    public void setSource_database(String source_database) {
        this.source_database = source_database;
    }

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "mid_year_population", nullable = true)
    public Double getMid_year_population() {
        return mid_year_population;
    }

    public void setMid_year_population(Double mid_year_population) {
        this.mid_year_population = mid_year_population;
    }

    @Basic
    @Column(name = "population_rate_0", nullable = true, precision = 0)
    public Double getPopulation_rate_0() {
        return population_rate_0;
    }

    public void setPopulation_rate_0(Double population_rate_0) {
        this.population_rate_0 = population_rate_0;
    }

    @Basic
    @Column(name = "population_rate_15", nullable = true, precision = 0)
    public Double getPopulation_rate_15() {
        return population_rate_15;
    }

    public void setPopulation_rate_15(Double population_rate_15) {
        this.population_rate_15 = population_rate_15;
    }

    @Basic
    @Column(name = "population_rate_65", nullable = true, precision = 0)
    public Double getPopulation_rate_65() {
        return population_rate_65;
    }

    public void setPopulation_rate_65(Double population_rate_65) {
        this.population_rate_65 = population_rate_65;
    }

    @Basic
    @Column(name = "female_rate", nullable = true, precision = 0)
    public Double getFemale_rate() {
        return female_rate;
    }

    public void setFemale_rate(Double female_rate) {
        this.female_rate = female_rate;
    }

    @Basic
    @Column(name = "increase_rate", nullable = true, precision = 0)
    public Double getIncrease_rate() {
        return increase_rate;
    }

    public void setIncrease_rate(Double increase_rate) {
        this.increase_rate = increase_rate;
    }

    @Basic
    @Column(name = "density", nullable = true, precision = 0)
    public Double getDensity() {
        return density;
    }

    public void setDensity(Double density) {
        this.density = density;
    }

    @Basic
    @Column(name = "birth_rate", nullable = true, precision = 0)
    public Double getBirth_rate() {
        return birth_rate;
    }

    public void setBirth_rate(Double birth_rate) {
        this.birth_rate = birth_rate;
    }

    @Basic
    @Column(name = "ave_life", nullable = true, precision = 0)
    public Double getAve_life() {
        return ave_life;
    }

    public void setAve_life(Double ave_life) {
        this.ave_life = ave_life;
    }

    @Basic
    @Column(name = "total_birth_rate", nullable = true, precision = 0)
    public Double getTotal_birth_rate() {
        return total_birth_rate;
    }

    public void setTotal_birth_rate(Double total_birth_rate) {
        this.total_birth_rate = total_birth_rate;
    }

    @Basic
    @Column(name = "death_rate", nullable = true, precision = 0)
    public Double getDeath_rate() {
        return death_rate;
    }

    public void setDeath_rate(Double death_rate) {
        this.death_rate = death_rate;
    }

    @Basic
    @Column(name = "baby_death_rate", nullable = true, precision = 0)
    public Double getBaby_death_rate() {
        return baby_death_rate;
    }

    public void setBaby_death_rate(Double baby_death_rate) {
        this.baby_death_rate = baby_death_rate;
    }

    @Basic
    @Column(name = "dependency_rate", nullable = true, precision = 0)
    public Double getDependency_rate() {
        return dependency_rate;
    }

    public void setDependency_rate(Double dependency_rate) {
        this.dependency_rate = dependency_rate;
    }

    @Basic
    @Column(name = "city_population", nullable = true)
    public Double getCity_population() {
        return city_population;
    }

    public void setCity_population(Double city_population) {
        this.city_population = city_population;
    }

    @Basic
    @Column(name = "city_population_rate", nullable = true, precision = 0)
    public Double getCity_population_rate() {
        return city_population_rate;
    }

    public void setCity_population_rate(Double city_population_rate) {
        this.city_population_rate = city_population_rate;
    }

    @Basic
    @Column(name = "village_population", nullable = true)
    public Double getVillage_population() {
        return village_population;
    }

    public void setVillage_population(Double village_population) {
        this.village_population = village_population;
    }

    @Basic
    @Column(name = "year", nullable = true, length = 4)
    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    @Basic
    @Column(name = "country_code", nullable = true, length = 255)
    public String getCountry_code() {
        return country_code;
    }

    public void setCountry_code(String country_code) {
        this.country_code = country_code;
    }

    @Basic
    @Column(name = "continent", nullable = true, length = 255)
    public String getContinent() {
        return continent;
    }

    public void setContinent(String continent) {
        this.continent = continent;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TPopulation that = (TPopulation) o;

        if (id != that.id) return false;
        if (mid_year_population != null ? !mid_year_population.equals(that.mid_year_population) : that.mid_year_population != null)
            return false;
        if (population_rate_0 != null ? !population_rate_0.equals(that.population_rate_0) : that.population_rate_0 != null)
            return false;
        if (population_rate_15 != null ? !population_rate_15.equals(that.population_rate_15) : that.population_rate_15 != null)
            return false;
        if (population_rate_65 != null ? !population_rate_65.equals(that.population_rate_65) : that.population_rate_65 != null)
            return false;
        if (female_rate != null ? !female_rate.equals(that.female_rate) : that.female_rate != null) return false;
        if (increase_rate != null ? !increase_rate.equals(that.increase_rate) : that.increase_rate != null)
            return false;
        if (density != null ? !density.equals(that.density) : that.density != null) return false;
        if (birth_rate != null ? !birth_rate.equals(that.birth_rate) : that.birth_rate != null) return false;
        if (ave_life != null ? !ave_life.equals(that.ave_life) : that.ave_life != null) return false;
        if (total_birth_rate != null ? !total_birth_rate.equals(that.total_birth_rate) : that.total_birth_rate != null)
            return false;
        if (death_rate != null ? !death_rate.equals(that.death_rate) : that.death_rate != null) return false;
        if (baby_death_rate != null ? !baby_death_rate.equals(that.baby_death_rate) : that.baby_death_rate != null)
            return false;
        if (dependency_rate != null ? !dependency_rate.equals(that.dependency_rate) : that.dependency_rate != null)
            return false;
        if (city_population != null ? !city_population.equals(that.city_population) : that.city_population != null)
            return false;
        if (city_population_rate != null ? !city_population_rate.equals(that.city_population_rate) : that.city_population_rate != null)
            return false;
        if (village_population != null ? !village_population.equals(that.village_population) : that.village_population != null)
            return false;
        if (year != null ? !year.equals(that.year) : that.year != null) return false;
        if (country_code != null ? !country_code.equals(that.country_code) : that.country_code != null) return false;
        if (continent != null ? !continent.equals(that.continent) : that.continent != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (mid_year_population != null ? mid_year_population.hashCode() : 0);
        result = 31 * result + (population_rate_0 != null ? population_rate_0.hashCode() : 0);
        result = 31 * result + (population_rate_15 != null ? population_rate_15.hashCode() : 0);
        result = 31 * result + (population_rate_65 != null ? population_rate_65.hashCode() : 0);
        result = 31 * result + (female_rate != null ? female_rate.hashCode() : 0);
        result = 31 * result + (increase_rate != null ? increase_rate.hashCode() : 0);
        result = 31 * result + (density != null ? density.hashCode() : 0);
        result = 31 * result + (birth_rate != null ? birth_rate.hashCode() : 0);
        result = 31 * result + (ave_life != null ? ave_life.hashCode() : 0);
        result = 31 * result + (total_birth_rate != null ? total_birth_rate.hashCode() : 0);
        result = 31 * result + (death_rate != null ? death_rate.hashCode() : 0);
        result = 31 * result + (baby_death_rate != null ? baby_death_rate.hashCode() : 0);
        result = 31 * result + (dependency_rate != null ? dependency_rate.hashCode() : 0);
        result = 31 * result + (city_population != null ? city_population.hashCode() : 0);
        result = 31 * result + (city_population_rate != null ? city_population_rate.hashCode() : 0);
        result = 31 * result + (village_population != null ? village_population.hashCode() : 0);
        result = 31 * result + (year != null ? year.hashCode() : 0);
        result = 31 * result + (country_code != null ? country_code.hashCode() : 0);
        result = 31 * result + (continent != null ? continent.hashCode() : 0);
        return result;
    }
}
